home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / astrot12.zip / ASTROTIM.XWS < prev    next >
Text File  |  1992-03-13  |  2KB  |  60 lines

  1. /*
  2.     AstroTime - CrossTalk for Windows Clock Setter
  3.  
  4.     ⌐ CompuTalking - RB March 1992
  5.       All Rights Reserved.
  6.       Version 1.2 13 March 1992
  7.  
  8.         
  9. */
  10.  
  11.     cls
  12.         string TRUETIME, TRUETEST, SHORTTIME, MINSEC, UNHOUR, NEWHOUR, ASTROTIME, DOSMIN, DOSSEC, BATTEXT, STRUNHOUR, GREENTIME, LOCATEU, MIDPOSITION, NOWTIME
  13.     if exists("c:\newtime.bat") then delete "c:\newtime.bat"
  14.     LABEL TEST
  15.     wait for "*|"
  16.     nextline TRUETIME
  17.     wait for "*|"
  18.     nextline TRUETEST
  19.     if length(TRUETIME)=length(TRUETEST) THEN GOTO GOODTEST ELSE GOTO TEST
  20.     LABEL GOODTEST
  21.     BYE
  22.     cls
  23.     NOWTIME=time
  24.     LOCATEU=instr(TRUETIME, "UT")
  25.     MIDPOSITION= LOCATEU - 7
  26.     SHORTTIME=MID(TRUETIME,MIDPOSITION,6)
  27.     MINSEC=right(SHORTTIME,4)
  28.     UNHOUR=intval(left(SHORTTIME,2))
  29.     NEWHOUR = UNHOUR + intval(PASSWORD)
  30.     if NEWHOUR < 0 THEN NEWHOUR = NEWHOUR + 24
  31.     DOSMIN=left(MINSEC,2)
  32.     DOSSEC=right(MINSEC,2)
  33.     STRUNHOUR=str(UNHOUR)
  34.     GREENTIME= STRUNHOUR + ":" + DOSMIN + ":" + DOSSEC
  35.     if NEWHOUR=0 then NEWHOUR="00" else NEWHOUR=str(NEWHOUR)
  36.     ASTROTIME= NEWHOUR + ":" + DOSMIN + ":" + DOSSEC
  37.     open random "c:\newtime.bat" as 1
  38.     BATTEXT= "time " + ASTROTIME
  39.     put 1, BATTEXT
  40.     close 1
  41.     run "C:\NEWTIME.BAT"
  42.     
  43.     dialogbox         100, 25, 130, 120
  44.         groupbox    5,   0, 120,  82, ""
  45.         ctext        8, 8, 110, 10, 'AstroTime'
  46.     ctext        8, 22, 110, 10, 'According to the'
  47.     ctext        8, 32, 110, 20, 'United States Naval Observatory'    
  48.     rtext        8, 48, 110, 10, 'GMT = ' + GREENTIME
  49.     rtext        8, 58, 110, 10, 'Local Time = ' + NOWTIME
  50.     rtext        8, 68, 110, 10, 'Corrected Local Time = ' + ASTROTIME
  51.     ctext        8,110,115,10, '⌐ CompuTalking - RB March 1992'
  52.     pushbutton    5, 90, 120,  14, 'Cancel', tabstop, cancel
  53.     enddialog
  54.  
  55.     if exists("c:\newtime.bat") then delete "c:\newtime.bat"
  56.     quit
  57. 
  58.  
  59.  
  60.